5110dbc002cc85230a638a8514911e1fca191497,tests/junit/org/jgroups/tests/MergeTest2.java,MergeTest2,mergeHelper,#String[]#,63
Before Change
}
// Make sure everyone is in sync
if(isMuxChannelUsed()){
blockUntilViewsReceived(channels, getMuxFactoryCount(), 60000);
}else{
blockUntilViewsReceived(channels, 60000);
}
// Sleep to ensure the threads get all the semaphore tickets
Util.sleep(2000);
int split = count/2;
for (int i = 0; i < split; i++) {
DISCARD discard=(DISCARD)((JChannel)channels[i].getChannel()).getProtocolStack().findProtocol("DISCARD");
for(int j=split;j<count;j++){
discard.addIgnoreMember(channels[j].getLocalAddress());
}
}
for (int i = count-1; i >= split; i--) {
DISCARD discard=(DISCARD)((JChannel)channels[i].getChannel()).getProtocolStack().findProtocol("DISCARD");
for(int j=0;j<split;j++){
discard.addIgnoreMember(channels[j].getLocalAddress());
}
}
System.out.println("Waiting for split to be detected...");
Util.sleep(20*1000);
System.out.println("Waiting for merging to kick in....");
for (int i = 0; i < count; i++) {
((JChannel)channels[i].getChannel()).getProtocolStack().removeProtocol("DISCARD");
}
//Either merge properly or time out...
if(isMuxChannelUsed()){
blockUntilViewsReceived(channels, getMuxFactoryCount(), 60000);
}else{
blockUntilViewsReceived(channels, 60000);
}
// Re-acquire the semaphore tickets; when we have them all
After Change
// Make sure everyone is in sync
blockUntilViewsReceived(channels, 60000);
// Sleep to ensure the threads get all the semaphore tickets
Util.sleep(2000);
int split = count/2;
for (int i = 0; i < split; i++) {
DISCARD discard=(DISCARD)((JChannel)channels[i].getChannel()).getProtocolStack().findProtocol("DISCARD");
for(int j=split;j<count;j++){
discard.addIgnoreMember(channels[j].getLocalAddress());
}
}
for (int i = count-1; i >= split; i--) {
DISCARD discard=(DISCARD)((JChannel)channels[i].getChannel()).getProtocolStack().findProtocol("DISCARD");
for(int j=0;j<split;j++){
discard.addIgnoreMember(channels[j].getLocalAddress());
}
}
System.out.println("Waiting for split to be detected...");
Util.sleep(20*1000);
System.out.println("Waiting for merging to kick in....");
for (int i = 0; i < count; i++) {
((JChannel)channels[i].getChannel()).getProtocolStack().removeProtocol("DISCARD");
}
//Either merge properly or time out...
blockUntilViewsReceived(channels, 60000);
// Re-acquire the semaphore tickets; when we have them all